<?php

require_once("lib/autoload.php");

#header('Content-type: application/json');

$id = $_GET["id"];
if (isset($id)) {
    $dc = new DataController();
    $dc->connect();    
    $survey = $dc->getSurvey($id);
    $dc->disconnect();
    
    if ($survey != NULL) {
        print json_encode(array("success"=>true,
                                "survey"=>$survey->getJsonArray()));
        return;
    }
}

print "{success: 'false'}";


?>